package file;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;

public class TestFile {

	public static void main(String[] args) {
		try {
			FileInputStream fin = new FileInputStream(
					"C:\\Users\\Administrator\\Desktop\\1.txt");
			int c = 0;
			while ((c = fin.read()) != -1) {
				System.out.println(c + "=" + (byte) c);
			}
			fin.close();
			FileOutputStream fout = new FileOutputStream(
					"C:\\Users\\Administrator\\Desktop\\2.txt");
			fout.write(206);
			fout.write(210);
			fout.write(205);
			fout.write(245);
			fout.close();
			FileWriter fw = new FileWriter(
					"C:\\Users\\Administrator\\Desktop\\3.txt");
			fw.write('a');
			fw.write('b');
			fw.write('流');
			fw.close();
		} catch (Exception e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}

	}

}
